program PROB003;
const
  max = 1000000;
var
  p : array[1..max] of longint;
  s, res : longint;
  n : int64;

function prime(k : longint) : boolean;
var
  i, c : longint;
begin
  prime := false;
  c := trunc(sqrt(k));
  for i := 1 to s do
  begin
    if p[i] > c then break;
    if k mod p[i] = 0 then exit;
  end;
  prime := true;
end;

procedure gen_p;
var
  i : longint;
begin
  s := 0;
  for i := 2 to 100000 do
    if prime(i) then
    begin
      inc(s);
      p[s] := i;
    end;
end;

procedure process;
var
  i : longint;
begin
  res := -1;
  for i := 1 to s do
    while n mod p[i] = 0 do
    begin
      n := n div p[i];
      if res < p[i] then res := p[i];
    end;
end;

begin
  gen_p;
  n := 317584931803;
  process;
  if n <> 1 then res := n;
  writeln(res);
end.
